home *** CD-ROM | disk | FTP | other *** search
/ Delphi Developer's Kit 1996 / Delphi Developer's Kit 1996.iso / power / accum / readme.txt < prev   
Text File  |  1995-12-22  |  7KB  |  177 lines

  1. This is the Readme.txt file for the component
  2. TAccumulator contained within Accum.pas.
  3.  
  4. {*******************************}
  5. { Author: Eric Uber             }
  6. { CIS Account: 71102,3034       }
  7. { Written: June 14th 1995.      }
  8. { Freeware, distribute at will. }
  9. {*******************************}
  10.  
  11. Description: TAccumulator is a Non-Visual component that 
  12.              provides various methods for the accumulation 
  13.              of ordinal values.
  14.  
  15.              Where you may normally declare a variable and
  16.              increment its value...
  17.               
  18.              Ex. i := i+1;  OR Inc(i);
  19.  
  20.              using this component
  21.  
  22.              Accumulator1.Add(1); OR Accumulator1.Inc;
  23.  
  24.              The advantage of using this component 
  25.              in the above example is you droped the accumulator
  26.              on the form opposed to declaring a var. The
  27.              component however gives the accumulator the scope 
  28.              of an object as well as the protection of an object.
  29.  
  30.              The TAccumulator component has methods for
  31.  
  32.              * incrementing
  33.              * Decrementing
  34.              * Adding
  35.              * Subtracting
  36.              * Dividing 
  37.              * Resetting accumulator
  38.  
  39.              Each of these are describe in this readme file.
  40.  
  41.              The TAccumulator component has several events that
  42.              execute just PRIOR to the computation: Being able to 
  43.              encapsulate code that fires upon a computation 
  44.              begins to show the power of this component. The 
  45.              events are:
  46.  
  47.              * OnInc
  48.              * OnDec
  49.              * OnAdd
  50.              * OnSubtract
  51.              * OnDivide
  52.              * OnMultiply
  53.  
  54.              The TAccumulator component has several properties.
  55.              They are:
  56.  
  57.              * property StartValue { Self explainatory }
  58.              * property MaxValue   { Ignored if 0 }
  59.              * property ExceptOnMaxValExceed:
  60.  
  61.              If ExceptOnMaxValExceed is set to true, and any
  62.              of the Methods are called that result in the
  63.              accumulator value exceeding MaxValue then an
  64.              exception is raise. You can capture this exception
  65.              using try..Except blocks.
  66.  
  67.              The most powerful implimentaion of the component
  68.              is when an array of pointers to the component is
  69.              used in your code or if the component is made a
  70.              member of another component.
  71.              
  72. The following is the Method information...
  73.  
  74. {----------------------------------------------------------}
  75. { Public Method: function TAccumulator.AccInc: LongInt;    }
  76.  
  77. { Purpose: Increments the accumulators current value.      }
  78.  
  79. { Returns: Result of computation or 0 (if                  }
  80. {          ExceptOnMaxValExceed is set to False and result }
  81. {          exceeds MaxValue). If ExceptOnMaxValExceed      }
  82. {          is set to true and the result exceeds MaxValue, }
  83. {          an exception called EMaxExceedError will occur. }
  84. {----------------------------------------------------------}
  85.  
  86. {----------------------------------------------------------}
  87. { Public Method: function TAccumulator.AccDec: LongInt;    }
  88.  
  89. { Purpose: Decrements the accumulators current value.      }
  90.  
  91. { Returns: Result of computation or 0 (if                  }
  92. {          ExceptOnMaxValExceed is set to False and result }
  93. {          exceeds MaxValue). If ExceptOnMaxValExceed      }
  94. {          is set to true and the result exceeds MaxValue, }
  95. {          an exception called EMaxExceedError will occur. }
  96. {----------------------------------------------------------}             
  97.  
  98. {----------------------------------------------------------}
  99. { Public Method: Add(liInValue: LongInt): LongInt;         }
  100.  
  101. { Purpose: Adds the value passed in Param1 to Accumulator  }
  102.  
  103. { Returns: Result of computation or 0 (if                  }
  104. {          ExceptOnMaxValExceed is set to False and result }
  105. {          exceeds MaxValue). If ExceptOnMaxValExceed      }
  106. {          is set to true and the result exceeds MaxValue, }
  107. {          an exception called EMaxExceedError will occur. }
  108. {----------------------------------------------------------}
  109.  
  110. {----------------------------------------------------------}
  111. { Public Method: function TAccumulator.Subtract(           }
  112. {                            liInValue: LongInt): LongInt; }
  113.  
  114. { Purpose: Sets the Accumulator to the result of its       }
  115. {          (current value - Param1).                       }
  116.  
  117. { Returns: Result of computation or 0 (if                  }
  118. {          ExceptOnMaxValExceed is set to False and result }
  119. {          exceeds MaxValue). If ExceptOnMaxValExceed      }
  120. {          is set to true and the result exceeds MaxValue, }
  121. {          an exception called EMaxExceedError will occur. }
  122. {----------------------------------------------------------}
  123.  
  124. {----------------------------------------------------------}
  125. { Public Method: function TAccumulator.Multiply(           }
  126. {                            liInValue: LongInt): LongInt; }
  127.  
  128. { Purpose: Sets the Accumulator to the result of its       }
  129. {          current value * Param1.                         }
  130.  
  131. { Returns: Result of computation or 0 (if                  }
  132. {          ExceptOnMaxValExceed is set to False and result }
  133. {          exceeds MaxValue). If ExceptOnMaxValExceed      }
  134. {          is set to true and the result exceeds MaxValue, }
  135. {          an exception called EMaxExceedError will occur. }
  136. {----------------------------------------------------------}
  137.  
  138. {----------------------------------------------------------}
  139. { Public Method: function TAccumulator.Divide(             }
  140. {                          liInValue: LongInt ): LongInt;  }
  141.  
  142. { Purpose: Sets the Accumulator to the result of its       }
  143. {          current value DIV Param1.                       }
  144.  
  145. { Returns: Result of computation or 0 (if                  }
  146. {          ExceptOnMaxValExceed is set to False and result }
  147. {          exceeds MaxValue). If ExceptOnMaxValExceed      }
  148. {          is set to true and the result exceeds MaxValue, }
  149. {          an exception called EMaxExceedError will occur. }
  150. {----------------------------------------------------------}
  151.  
  152. {----------------------------------------------------------}
  153. { Public Method: function GetCurrentValue: LongInt;        }
  154.  
  155. { Purpose: To retrieve the accumulators current value.     }
  156.  
  157. { Returns: The Accumulators current value. If              }
  158. {          ExceptOnMaxValExceed is set to true and the     }
  159. {          Accumulators current value exceeds MaxValue, an }
  160. {          exception called EMaxExceedError will occur.    }
  161. {----------------------------------------------------------}
  162.  
  163. {----------------------------------------------------------}
  164. { Public Method: procedure TAccumulator.Reset;             }
  165.  
  166. { Purpose: Resets Accumulator to value of StartValue       }
  167.  
  168. { Returns: Nothing. This is a procedure.                   }
  169. {----------------------------------------------------------}
  170.  
  171.  
  172.  
  173. {----------------------------------------------------------}
  174.  Please report suggestions or bugs to...
  175.  Author: Eric Uber           
  176.  CIS Account: 71102,3034 
  177. {----------------------------------------------------------}